<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<%@ page language="java" import="java.util.ArrayList"
	import="dao.DataAccess" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link
	href="<%=request.getContextPath()%>/CSS/ui-darkness/jquery-ui-1.9.2.custom.css"
	rel="stylesheet">
<script src="<%=request.getContextPath()%>/JS/jquery-1.8.3.js"></script>
<script src="<%=request.getContextPath()%>/JS/jquery-ui-1.9.2.custom.js"></script>

<title>FlangeData - View</title>
<style>
body {
	font: 62.5% "Trebuchet MS", sans-serif;
	margin: 50px;
}

.demoHeaders {
	margin-top: 2em;
}

#dialog-link {
	padding: .4em 1em .4em 20px;
	text-decoration: none;
	position: relative;
}

#dialog-link span.ui-icon {
	margin: 0 5px 0 0;
	position: absolute;
	left: .2em;
	top: 50%;
	margin-top: -8px;
}

#icons {
	margin: 0;
	padding: 0;
}

#icons li {
	margin: 2px;
	position: relative;
	padding: 4px 0;
	cursor: pointer;
	float: left;
	list-style: none;
}

#icons span.ui-icon {
	float: left;
	margin: 0 4px;
}
</style>
<script>
	$(function() {

		$("#button").button();
	});
</script>
<script type="text/javascript" language="javascript"
	src="<%=request.getContextPath()%>/JS/jquery.js"></script>
<script type="text/javascript" language="javascript"
	src="<%=request.getContextPath()%>/JS/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		oTable = $('#example').dataTable({
			"bJQueryUI" : true,
			"sPaginationType" : "full_numbers"
		});
	});
</script>
<script type="text/javascript">
	(function() {
		var bsa = document.createElement('script');
		bsa.type = 'text/javascript';
		bsa.async = true;
		bsa.src = '//s3.buysellads.com/ac/bsa.js';
		(document.getElementsByTagName('head')[0] || document
				.getElementsByTagName('body')[0]).appendChild(bsa);
	})();

	$(function() {

		$("#accordion").accordion({
			collapsible : true
		});

		$("#button").button();
		$('#closebutton').button();
		$("#radioset").buttonset();

		$("#tabs").tabs();

		$("#dialog").dialog({
			autoOpen : false,
			width : 400,
			buttons : [ {
				text : "Ok",
				click : function() {
					$(this).dialog("close");
				}
			}, {
				text : "Cancel",
				click : function() {
					$(this).dialog("close");
				}
			} ]
		});

		// Link to open the dialog
		$("#dialog-link").click(function(event) {
			$("#dialog").dialog("open");
			event.preventDefault();
		});

		$("#GEN_Workdate").datepicker({
			dateFormat : "yy-mm-dd",
			inline : true

		});
		$("#RAS_onBehalfOfDate").datepicker({
			dateFormat : "yy-mm-dd",
			inline : true
		});
		$("#RAS_justriteDate").datepicker({
			dateFormat : "yy-mm-dd",
			inline : true
		});

		$("#slider").slider({
			range : true,
			values : [ 17, 67 ]
		});

		$("#progressbar").progressbar({
			value : 20
		});

		// Hover states on the static widgets
		$("#dialog-link, #icons li").hover(function() {
			$(this).addClass("ui-state-hover");
		}, function() {
			$(this).removeClass("ui-state-hover");
		});
	});
</script>
<style>
body {
	font: 62.5% "Trebuchet MS", sans-serif;
	margin: 50px;
}

.demoHeaders {
	margin-top: 2em;
}

#dialog-link {
	padding: .4em 1em .4em 20px;
	text-decoration: none;
	position: relative;
}

#dialog-link span.ui-icon {
	margin: 0 5px 0 0;
	position: absolute;
	left: .2em;
	top: 50%;
	margin-top: -8px;
}

#icons {
	margin: 0;
	padding: 0;
}

#icons li {
	margin: 2px;
	position: relative;
	padding: 4px 0;
	cursor: pointer;
	float: left;
	list-style: none;
}

#icons span.ui-icon {
	float: left;
	margin: 0 4px;
}
</style>

</head>


<%@ include file="links.jsp"%>
<%@ include file="search.jsp"%>

<%
	if ((ArrayList<String>) request.getAttribute("AList") != null) {
		ArrayList<String> AList = (ArrayList<String>) request
				.getAttribute("AList");
		int i_max = AList.size();
		int j_max = i_max / 55;
		System.out.println("Size Retrieved -----------------> "
				+ AList.size());
		System.out
				.println("Number of Entries --------------> " + j_max);
%>





<body>



	<%
		if (i_max == 0) {
	%>

	<div class="ui-widget">
		<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
			<p>
				<span class="ui-icon ui-icon-alert"
					style="float: left; margin-right: .3em;"></span> <strong>Sorry
					! </strong> No Results found!
			</p>
		</div>
	</div>

	<%
		} else {
	%>
	<div class="ui-widget">
		<div class="ui-state-highlight ui-corner-all"
			style="margin-top: 20px; padding: 0 .7em;">
			<p>
				<span class="ui-icon ui-icon-info"
					style="float: left; margin-right: .3em;"></span> <strong>Hey!</strong>
				Found <strong><%=j_max%> </strong>Results !
			</p>
		</div>
	</div>

	<%
		}
	%>

	<h1>Instructions</h1>
	<p>Choose from the buttons above to search based on the Client
		Name, or Flange Location, or the Flange ID !</p>



	<h1>Search Results</h1>
	<input type="hidden" name="whereFrom" value="makeEntry">
	<div id="accordion">
		<%
			for (int j = 1; j < j_max + 1; j++) {
		%>
		<div>
			Entry #
			<%=j%></div>

		<div>
			<h2>General</h2>
			<table border="1px solid">
				<tr>
					<th>Client Name</th>
					<th>Flange Identification</th>
					<th>Flange Location</th>
					<th>HBT Supervisor</th>
					<th>HBT Technician</th>
					<th>Workdate</th>
				</tr>
				<tr>
					<%
						for (int i = 0; i < 6; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>


			</table>
			<h2>Joint Integrity Record</h2>
			<table border="1px solid">
				<tr>
					<th>Top</th>
					<th>Bottom</th>
					<th>Left</th>
					<th>Right</th>
					<th>Remarks</th>
				</tr>
				<tr>
					<%
						for (int i = 6; i < 11; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>

			</table>
			<h2>Flange Data</h2>
			<table border="1px solid">
				<tr>
					<th>Nom Dia And Flange Class</th>
					<th>Gasket Type</th>
					<th>Gasket Material</th>
					<th>Bolt Material</th>
					<th>Flange Material</th>
					<th>Bolt Diameter</th>
					<th>No. of Bolts</th>
					<th>Joint Configuration</th>
					<th>Flange/Line Test Pressure</th>
				</tr>
				<tr>
					<%
						for (int i = 11; i < 20; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>

			</table>
			<h2>Bolt Tensioner Record</h2>
			<table border="1px solid">
				<tr>
					<th>No. of Tensioners Used</th>
					<th>Pump Serial Number</th>
					<th>1st Pass Pressure</th>
					<th>2nd Pass Pressure</th>
					<th>Checking Pass Pressure</th>
				</tr>

				<tr>
					<%
						for (int i = 20; i < 25; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>
			</table>
			<h2>Visual Checks</h2>
			<table border="1px solid">
				<tr>
					<th>Bolt Condition</th>
					<th>Flange Prepared By</th>
					<th>Minimum Thread Protrusion</th>
					<th>Thread Form</th>
					<th>Flange Face Condition</th>
				</tr>

				<tr>
					<%
						for (int i = 25; i < 30; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>
			</table>
			<h2>Equipment and Tool</h2>
			<table border="1px solid">
				<tr>
					<th>Bolt Tensioner</th>
					<th>Model</th>
					<th>Torque Wrench</th>
					<th>Model</th>
					<th>Flogging Spanner</th>
					<th>Model</th>
				</tr>
				<tr>
					<%
						for (int i = 30; i < 36; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>

			</table>


			<h2>Bolt Torquing Record</h2>
			<table border="1px solid">
				<tr>
					<th>No. of Torque Wrenches Used</th>
					<th>Pump Serial Number</th>
					<th>Lubricant Used</th>
					<th>Lubricant Applied By</th>
					<th>Torque Applied</th>
				</tr>
				<tr>
					<%
						for (int i = 36; i < 41; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>
			</table>
			<h2>Justrite Recommended Loads</h2>
			<table border="1px solid">
				<tr>
					<th>Residual Bolt Load</th>
					<th>Residual Bolt Stress</th>
					<th>Torque</th>
					<th>Coefficient of Friction</th>
					<th>Pressure Applied</th>
				</tr>
				<tr>
					<%
						for (int i = 41; i < 46; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>
			</table>
			<h2>Customer Specified Loads</h2>
			<table border="1px solid">
				<tr>
					<th>Residual Bolt Load</th>
					<th>Residual Bolt Stress</th>
					<th>Torque</th>
				</tr>
				<tr>
					<%
						for (int i = 46; i < 49; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>
			</table>
			<h2>Review and Acceptance Signatures</h2>
			<table border="1px solid">
				<tr>
					<th>On Behalf of Justrite : Name</th>
					<th>Date</th>
					<th>Acceptance on Behalf of (Company?)</th>
					<th>Acceptor's Name</th>
					<th>Date</th>
					<th>Flange Tags Attached</th>
				</tr>
				<tr>
					<%
						for (int i = 49; i < 55; i++) {
					%>
					<td><%=AList.get(((j - 1) * 55) + i)%></td>
					<%
						}
					%>
				</tr>
			</table>
		</div>


		<%
			}
		%>
	</div>



	<div id="footer" class="clear" style="text-align: center;">
		<p></p>

		<span style="font-size: 10px;"> Flange Data designed and
			created by <strong>A-Labs</strong> &copy; 2013<br>
		</span>
	</div>
</body>
<%
	} else {
%>
<body>
	<h1>Enter a Search Criteria !</h1>


	<div id="footer" class="clear" style="text-align: center;">
		<p></p>

		<span style="font-size: 10px;"> Flange Data designed and
			created by <strong>A-Labs</strong> &copy; 2013<br>
		</span>
	</div>
</body>
<%
	}
%>
</html>